/**
 * output package name
 */
package com.kingdee.eas.custom.hr.assessment.report.client;

import java.awt.event.*;
import org.apache.log4j.Logger;

import com.kingdee.bos.metadata.entity.EntityViewInfo;
import com.kingdee.bos.metadata.entity.FilterInfo;
import com.kingdee.bos.metadata.entity.FilterItemInfo;
import com.kingdee.bos.metadata.entity.SelectorItemCollection;
import com.kingdee.bos.metadata.query.util.CompareType;
import com.kingdee.bos.ui.face.CoreUIObject;
import com.kingdee.bos.ctrl.extendcontrols.KDBizPromptBox;
import com.kingdee.bos.dao.IObjectValue;
import com.kingdee.eas.framework.*;
import com.kingdee.eas.framework.report.util.RptParams;

/**
 * output class name
 */
public class FloatingBounsFilterUI extends AbstractFloatingBounsFilterUI
{
    private static final Logger logger = CoreUIObject.getLogger(FloatingBounsFilterUI.class);
    
    /**
     * output class constructor
     */
    public FloatingBounsFilterUI() throws Exception
    {
        super();
    }

    /**
     * output storeFields method
     */
    public void storeFields()
    {
        super.storeFields();
    }

	public RptParams getCustomCondition() {
  		// TODO Auto-generated method stub

  		RptParams params = new RptParams();
  		params.setObject("prmtApplyDate", prmtApplyDate.getValue());
  		params.setObject("prmtPerson", prmtPerson.getValue());
  		params.setObject("prmtDept",prmtDept.getValue());

  		return params;
  	}

  	public void onInit(RptParams arg0) throws Exception {
  		// TODO Auto-generated method stub
//  		pkApTimeFrom.setRequired(true);
//  		pkApTimeTo.setRequired(true);
  		 StringBuffer sql = new StringBuffer();
	     sql.append("select person.fid from T_BD_Person person ")
	    .append("left join T_HR_EmployeeClassify EmployeeClassify on person.femployeeclassifyid = EmployeeClassify.fid ")
	    .append("left join T_CAN_Grade grade on person.FGradeID = grade.fid ")
	    .append("where (EmployeeClassify.Flongnumber like '%0!%' or EmployeeClassify.Flongnumber like '%1!%')")
	    .append("and grade.cflevel < 3 ")
	    .append("and person.FGradeID is not null ");
		KDBizPromptBox f7 = (KDBizPromptBox)(this.prmtPerson);
		SelectorItemCollection selectors = new SelectorItemCollection();
		selectors.add("*");
		EntityViewInfo viewInfoSq = new EntityViewInfo();
		FilterInfo filterSq = new FilterInfo();
		filterSq.getFilterItems().add(new FilterItemInfo("id",sql.toString(),CompareType.INNER));
		viewInfoSq.setFilter(filterSq);
		f7.setEntityViewInfo(viewInfoSq);
		f7.setSelectorCollection(selectors);
  		
  	}

  	public void setCustomCondition(RptParams params) {
  		// TODO Auto-generated method stub
  		prmtApplyDate.setValue(params.getObject("prmtApplyDate"));
  		prmtPerson.setValue(params.getObject("prmtPerson"));
  		prmtDept.setValue(params.getObject("prmtDept"));
  	}


}